Q: I am trying to use the AppleTalk AFPCommand() call with a csCode of
afpGetFlDrParms , but it isn't working properly. I need to get all of the
information that is displayed in the Sharing window when a user selects a
shared folder and chooses "Sharing..." from the Finder's File menu. I've
checked the second edition of Inside AppleTalk and the AppleShare 3.0
SDK, but I can't find anything to help me get this working. What should I do to
get this specific AFPCommand() variation and afpSetFlDrParms to work?
A: There are very few good reasons to call the .XPP driver to talk to an AFP
server directly. As noted in
Technical Note "NW 16 - Borrowed AFP Sessions" (in the section titled "Session Borrowing Rules and Restrictions"), "If it can be
done with File Manager functions, use the File Manager functions -- don't use
AFP calls." Here's how to get the information displayed in the Finder's "Sharing..." dialog using File Manager:
Where
You can obtain the Where information on AFP volumes with PBGetVolMountInfoSize
(to get the volume mount record size) and PBGetVolMountInfo . You can also
create an alias to the volume with NewAlias and use GetAliasInfo to extract the
zone and server name from the alias record.
Connected As
Use PBHGetLogInInfo to obtain the Connected As name.
Privileges
You can obtain the Privileges information with PBGetCatInfo (zero ioAcUser as
an input; the connected user's privileges are returned in the ioAcUser field)
or with PBHGetDirAccess .
Owner, User/Group, and Everyone
Use PBHGetDirAccess to obtain the Owner, User/Group, and Everyone privileges.
To map the user and group ID numbers from PBHGetDirAccess to the user/group
names, use PBHMapID .
To change the Owner, User/Group, and Everyone privileges, use PBHSetDirAccess .
You can map the user/group name(s) entered in the dialog (if the user changes
them) to their user or group ID numbers with PBHMapName before calling
PBHSetDirAccess .
If the volume is local, you can share or un-share it with PBShare and
PBUnshare . To fill in the Owner and User/Group pop-up menus with the user and
group names, use PBGetUGEntry .
|